package com.stone.design.patterns.template;

/**
 * @author Stone
 * @version V1.0
 * @description:
 * @date 4/21/18 15:05
 * @email redsstone@163.com
 */
public abstract class CaffeineBeverageWithHook {

    public void perpareRecipe() {
        boilWater();
        brew();
        pourInCup();
        if (customerWantsCondiments()) {
            addCondiments();
        }
    }

    abstract void brew();
    abstract void addCondiments();
    void boilWater() {

    }

    void pourInCup() {

    }

    boolean customerWantsCondiments() {
        return true;
    }

}
